{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 采用 xgboost 模型完成商品分类"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 第二步：调整树的参数：max_depth & min_child_weight\n",
    "在粗调最佳参数周围，将步长降为1，进行精细调整)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "首先导入必要的工具包"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "from xgboost import XGBClassifier\n",
    "import xgboost as xgb\n",
    "\n",
    "import pandas as pd \n",
    "import numpy as np\n",
    "\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.model_selection import StratifiedKFold\n",
    "\n",
    "from sklearn.metrics import log_loss\n",
    "\n",
    "from matplotlib import pyplot\n",
    "import seaborn as sns\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###   数据读取\n",
    "注：数据已经提前被处理，只需根据作业要求读取 RentListingInquries_FE_train.csv 文件即可"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# path to where the data lies\n",
    "path = './data/' \n",
    "fileName = 'RentListingInquries_FE_train.csv'\n",
    "\n",
    "data=pd.read_csv(path+fileName)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Target 分布，看看各类样本分布是否均衡"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZUAAAEKCAYAAADaa8itAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAGlRJREFUeJzt3X+0XW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+B5wIPA3wNfaUXlL4H3V9XnkxwFrKuqZyd5C/BQVf3hnv6N0mwOHHcC0j4swDvaS7geY/A6gsPbvn+qqqvb+nHAZ6tqG0CSvwJ+vO17GXDsYIopAJ7eXgYl7ZUsKtLovAaYAp5fVf8vydeBJ7d93xlqN9OrC6YdALywqv7vcHCoyEh7FTvqpX49CExfSTwDuKcVlJcwuO01k2uBn0+yoN0y+7dD+/6WwWShACRZMsP3SHsNi4rUo6r6NvCFJDcDS4ClSTYwuGr56k6O+SbwDgZvDPw74Bbg/rb719s5bkxyC/D6Fv8k8Io2K+6/HtkPknaRHfXSXiDJU6vqoXal8nFgVVV9fNx5SbvKKxVp7/CWJDcANwNfAz4x5nyk3eKViiSpN16pSJJ6Y1GRJPXGoiJJ6o1FRZLUG4uKJKk3FhVJUm/+P7RyK1qmT6eeAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.countplot(data.interest_level);\n",
    "pyplot.xlabel('target');\n",
    "pyplot.ylabel('Number of occurrences');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 从原始数据中分离输入特征x和输出y\n",
    "X = data.drop('interest_level', axis = 1)\n",
    "y = data['interest_level']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "columns = X.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 将数据分割训练数据与测试数据\n",
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "# 随机采样20%的数据构建测试样本，其余作为训练样本\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3,random_state = 0)\n",
    "#print('X_train.shape: %s %s'%X_train.shape)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "各类样本不均衡，交叉验证是采用StratifiedKFold，在每折采样时各类样本按比例采样"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "# prepare cross validation\n",
    "kfold = StratifiedKFold(n_splits=5, shuffle=True, random_state=3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 第一轮参数调整得到的n_estimators最优值（187），其余参数继续默认值\n",
    "用交叉验证评价模型性能时，用scoring参数定义评价指标。评价指标是越高越好，因此用一些损失函数当评价指标时，需要再加负号，如neg_log_loss，neg_mean_squared_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'max_depth': [4, 5, 6], 'min_child_weight': [1, 2]}"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#设置精细调整的区间\n",
    "max_depth = [4,5,6]\n",
    "min_child_weight = [1,2]\n",
    "param_test2_2 = dict(max_depth=max_depth, min_child_weight=min_child_weight)\n",
    "param_test2_2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/root/anaconda3/lib/python3.6/site-packages/sklearn/model_selection/_search.py:761: DeprecationWarning: The grid_scores_ attribute was deprecated in version 0.18 in favor of the more elaborate cv_results_ attribute. The grid_scores_ attribute will not be available from 0.20\n",
      "  DeprecationWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "([mean: -0.60198, std: 0.00274, params: {'max_depth': 4, 'min_child_weight': 1},\n",
       "  mean: -0.60240, std: 0.00301, params: {'max_depth': 4, 'min_child_weight': 2},\n",
       "  mean: -0.59740, std: 0.00366, params: {'max_depth': 5, 'min_child_weight': 1},\n",
       "  mean: -0.59791, std: 0.00374, params: {'max_depth': 5, 'min_child_weight': 2},\n",
       "  mean: -0.59831, std: 0.00280, params: {'max_depth': 6, 'min_child_weight': 1},\n",
       "  mean: -0.59859, std: 0.00260, params: {'max_depth': 6, 'min_child_weight': 2}],\n",
       " {'max_depth': 5, 'min_child_weight': 1},\n",
       " -0.5973984751972113)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "xgb2_2 = XGBClassifier(\n",
    "        learning_rate =0.1,\n",
    "        n_estimators=187,  #第一轮参数调整得到的n_estimators最优值\n",
    "        max_depth=5,\n",
    "        min_child_weight=1,\n",
    "        gamma=0,\n",
    "        subsample=0.3,\n",
    "        colsample_bytree=0.8,\n",
    "        colsample_bylevel = 0.7,\n",
    "        objective= 'multi:softprob',\n",
    "        seed=3)\n",
    "\n",
    "\n",
    "gsearch2_2 = GridSearchCV(xgb2_2, param_grid = param_test2_2, scoring='neg_log_loss',n_jobs=-1, cv=kfold)\n",
    "gsearch2_2.fit(X_train , y_train)\n",
    "\n",
    "gsearch2_2.grid_scores_, gsearch2_2.best_params_,     gsearch2_2.best_score_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/root/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split0_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/root/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split1_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/root/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split2_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/root/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split3_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/root/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split4_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/root/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('mean_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/root/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('std_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'mean_fit_time': array([ 77.61599674,  81.2972724 , 105.96292505, 105.66518211,\n",
       "        130.0267705 , 108.18021584]),\n",
       " 'std_fit_time': array([ 1.14270926,  3.90032571,  1.01572307,  0.85382873,  0.58001196,\n",
       "        15.13268978]),\n",
       " 'mean_score_time': array([0.43964915, 0.39265633, 0.44720516, 0.45660768, 0.62297239,\n",
       "        0.40989223]),\n",
       " 'std_score_time': array([0.04568042, 0.02600601, 0.03206781, 0.02339302, 0.06493694,\n",
       "        0.0141613 ]),\n",
       " 'param_max_depth': masked_array(data=[4, 4, 5, 5, 6, 6],\n",
       "              mask=[False, False, False, False, False, False],\n",
       "        fill_value='?',\n",
       "             dtype=object),\n",
       " 'param_min_child_weight': masked_array(data=[1, 2, 1, 2, 1, 2],\n",
       "              mask=[False, False, False, False, False, False],\n",
       "        fill_value='?',\n",
       "             dtype=object),\n",
       " 'params': [{'max_depth': 4, 'min_child_weight': 1},\n",
       "  {'max_depth': 4, 'min_child_weight': 2},\n",
       "  {'max_depth': 5, 'min_child_weight': 1},\n",
       "  {'max_depth': 5, 'min_child_weight': 2},\n",
       "  {'max_depth': 6, 'min_child_weight': 1},\n",
       "  {'max_depth': 6, 'min_child_weight': 2}],\n",
       " 'split0_test_score': array([-0.60496482, -0.60485766, -0.60278146, -0.60254873, -0.59947678,\n",
       "        -0.60076589]),\n",
       " 'split1_test_score': array([-0.59867695, -0.59856096, -0.59416526, -0.59487703, -0.59616722,\n",
       "        -0.59714058]),\n",
       " 'split2_test_score': array([-0.6009286 , -0.60166267, -0.59355476, -0.59348029, -0.59589625,\n",
       "        -0.59596248]),\n",
       " 'split3_test_score': array([-0.599866  , -0.60014549, -0.59586417, -0.59650181, -0.59668731,\n",
       "        -0.59649822]),\n",
       " 'split4_test_score': array([-0.60547373, -0.60676401, -0.60062688, -0.60212098, -0.60330121,\n",
       "        -0.60256412]),\n",
       " 'mean_test_score': array([-0.60198191, -0.60239799, -0.59739848, -0.59790569, -0.59830558,\n",
       "        -0.59858616]),\n",
       " 'std_test_score': array([0.00274226, 0.00301491, 0.00366015, 0.0037431 , 0.0028043 ,\n",
       "        0.00260407]),\n",
       " 'rank_test_score': array([5, 6, 1, 2, 3, 4], dtype=int32),\n",
       " 'split0_train_score': array([-0.54856076, -0.54988015, -0.50845671, -0.51154037, -0.45561737,\n",
       "        -0.46380904]),\n",
       " 'split1_train_score': array([-0.54970911, -0.55137311, -0.50807877, -0.51198097, -0.45850308,\n",
       "        -0.46448709]),\n",
       " 'split2_train_score': array([-0.54989455, -0.55132107, -0.50901464, -0.51301688, -0.45892279,\n",
       "        -0.46722671]),\n",
       " 'split3_train_score': array([-0.54896017, -0.54991433, -0.50946109, -0.5139941 , -0.45731367,\n",
       "        -0.46557366]),\n",
       " 'split4_train_score': array([-0.54856729, -0.55016708, -0.50708036, -0.51023064, -0.45834152,\n",
       "        -0.46524688]),\n",
       " 'mean_train_score': array([-0.54913837, -0.55053115, -0.50841832, -0.51215259, -0.45773969,\n",
       "        -0.46526868]),\n",
       " 'std_train_score': array([0.00056375, 0.00067375, 0.00081852, 0.00128346, 0.00118579,\n",
       "        0.00115488])}"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gsearch2_2.cv_results_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Best: -0.597398 using {'max_depth': 5, 'min_child_weight': 1}\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/root/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('mean_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/root/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('std_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/root/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split0_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/root/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split1_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/root/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split2_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/root/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split3_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/root/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split4_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZoAAAELCAYAAADgPECFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xd4VGX2wPHvIZVOEloQMagooEDACKKCWHDtFTv7A8uqiOuqa8G16xZUrLvWVVmVIsWGroWqKC5gEnovIoQAgVBCgISU8/vj3kAIM8kk5M5MkvN5nnnmzm1z5maSk/d97z1XVBVjjDHGK/VCHYAxxpjazRKNMcYYT1miMcYY4ylLNMYYYzxlicYYY4ynLNEYY4zxlCUaY4wxnrJEY4wxxlOWaIwxxngqMtQBhIPmzZtrUlJSqMMwxpgaJS0tbZuqtqhoPUs0QFJSEqmpqaEOwxhjahQR+S2Q9azrzBhjjKcs0RhjjPGUJRpjjDGeskRjjDHGU5ZojDHGeMoSjTHGGE9ZojHGGOMpSzTGGFNHjZr9Gxu27/X8fSzRGGNMHTR16RYe+3wx78/61fP3skRjjDF1zPrsvdw/fj4nH9WEhy/o6Pn7WaIxxpg6JK+giCGj0wB486ZTiI2K8Pw9rdaZMcbUIU9NWsKSzBzeG5TC0fENgvKe1qIxxpg6YkLqBj7+ZQNDzz6Oczu1Ctr7WqIxxpg6YGlmDo99vpjTj0vg/v4nBvW9LdEYY0wtl5NXwF2j02jWIIrXbuhORD0J6vvbGI0xxtRiqsoD4xeQsWMfH99+Gs0bxQQ9BmvRGGNMLfbvH9cyeekWhl3YkZSk+J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vynn5/egAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# summarize results\n",
    "print(\"Best: %f using %s\" % (gsearch2_2.best_score_, gsearch2_2.best_params_))\n",
    "test_means = gsearch2_2.cv_results_[ 'mean_test_score' ]\n",
    "test_stds = gsearch2_2.cv_results_[ 'std_test_score' ]\n",
    "train_means = gsearch2_2.cv_results_[ 'mean_train_score' ]\n",
    "train_stds = gsearch2_2.cv_results_[ 'std_train_score' ]\n",
    "\n",
    "pd.DataFrame(gsearch2_2.cv_results_).to_csv('my_preds_maxdepth_min_child_weights_2.csv')\n",
    "\n",
    "# plot results\n",
    "test_scores = np.array(test_means).reshape(len(min_child_weight), len(max_depth))\n",
    "train_scores = np.array(train_means).reshape(len(min_child_weight), len(max_depth))\n",
    "\n",
    "for i, value in enumerate(min_child_weight):\n",
    "    pyplot.plot(max_depth, test_scores[i], label= 'test_min_child_weight:'   + str(value))\n",
    "#for i, value in enumerate(min_child_weight):\n",
    "#    pyplot.plot(max_depth, train_scores[i], label= 'train_min_child_weight:'   + str(value))\n",
    "    \n",
    "pyplot.legend()\n",
    "pyplot.xlabel( 'max_depth' )                                                                                                      \n",
    "pyplot.ylabel( '- Log Loss' )\n",
    "pyplot.savefig( 'max_depth_vs_min_child_weght2.png' )"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 再次搜索的结果参数为：'max_depth': 5, 'min_child_weight': 1，与前一次结果相同，故此最优的n_estimators=187"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
